package 带有缓冲区的字符流;

import java.io.*;

public class 节点流和包装流 {
    public static void main(String[] args) {
        FileInputStream in = null;
        BufferedReader br = null;

        try {
////            字节流
//            in = new FileInputStream("IO流/src/myfile");
////            通过转换流将字节流转换为字符流
////            此时in是节点流，reader是包装流
//            InputStreamReader reader = new InputStreamReader(in);
////            此时reader是节点流，br是包装流
//            br = new BufferedReader(reader);

//            合并写法
            br = new BufferedReader(new InputStreamReader(new FileInputStream("IO流/src/myfile")));
            String line = null;
            while ((line = br.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
